#include "preprocessing.h"

PreProcessing::PreProcessing(void)
{
	_stopWord = new StopWord;
	_keyWordMgr = new KeyWord;
}

PreProcessing::~PreProcessing(void)
{
}

vector<string> PreProcessing::textSplit(string& str)
{
	vector<string> data = Spliter::split(str, ".", true);

	return data;
}

void PreProcessing::dropStopWord(vector<string>& strVec)
{
	vector<string>::iterator iter;
	for(iter=strVec.begin(); iter!=strVec.end();)
	{
		if(_stopWord->isStopWord(*iter))
		{
			iter = strVec.erase(iter);
		}else{
			++iter;
		}
	}
}

vector<string> PreProcessing::keyWord(vector<string>& str)
{
	vector<string> key = _keyWordMgr->getKeyWord(str);
	return key;
}